#@layout()
#define css()
<style type="text/css">
    .switchery-item {
        padding-bottom: 10px;
    }

    .switchery-item .switchery-small {
        margin-top: -2px;
        margin-right: 10px;
    }
</style>
#end

#define content()
    <section class="content-header">
        <div class="container-fluid">
            <div class="row">
                <div class="col-sm-6">

                    <div class="row mb-2">
                        <div class="col-sm-12">
                            <h1>
                                页面设置
                                <small data-toggle="tooltip" title="" data-placement="right"
                                       data-trigger="hover"><i class="nav-icon far fa-question-circle"></i></small>
                                <small> 首页 / 页面 / 页面设置</small>
                            </h1>
                        </div>
                    </div>
                </div>
            </div>


        </div><!-- /.container-fluid -->
    </section>

    <section class="content">

        <div class="container-fluid">
                <div class="card card-outline card-primary">

                    <!-- form start -->
                    <form class=" form-setting" autocomplete="off" id="optionForm">
                        <div class="card-body">
                            <h4 class="form-header">评论功能</h4>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label"></label>
                                <div class="col-sm-6">
                                    <div class="switchery-item">
                                        <input type="checkbox" class="switchery" data-for="page_comment_enable"
                                               #checkedIf(option("page_comment_enable","true"))>
                                        <input type="hidden" id="page_comment_enable" name="page_comment_enable">
                                        开启评论功能
                                    </div>
                                    <div class="switchery-item">
                                        <input type="checkbox" class="switchery"
                                               data-for="page_comment_unlogin_enable" #checkedIf(option("page_comment_unlogin_enable"))>
                                        <input type="hidden" id="page_comment_unlogin_enable"
                                               name="page_comment_unlogin_enable"> 允许未登录用户发表评论
                                    </div>
                                    <div class="switchery-item">
                                        <input type="checkbox" class="switchery"
                                               data-for="page_comment_review_enable" #checkedIf(option("page_comment_review_enable"))>
                                        <input type="hidden" id="page_comment_review_enable"
                                               name="page_comment_review_enable"> 评论必须经过管理员审核
                                    </div>
                                    <div class="switchery-item">
                                        <input type="checkbox" class="switchery" data-for="page_comment_vcode_enable"
                                               #checkedIf(option("page_comment_vcode_enable","true"))>
                                        <input type="hidden" id="page_comment_vcode_enable"
                                               name="page_comment_vcode_enable"> 启用评论验证码功能
                                    </div>
                                </div>
                            </div>


                            <h4 class="form-header">评论邮件通知管理员</h4>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">启用</label>
                                <div class="col-sm-6">
                                    <input type="checkbox" class="switchery"
                                           data-for="page_comment_email_notify_enable"
                                           #checkedIf(option("page_comment_email_notify_enable"))>
                                    <input type="hidden" id="page_comment_email_notify_enable"
                                           name="page_comment_email_notify_enable">
                                    <p class="text-muted"> 请先在 <a href="#(CPATH)/admin/setting">[常规设置]</a> 开填写管理员邮箱。
                                </div>
                            </div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">邮件标题</label>
                                <div class="col-sm-6">
                                    <input type="input" class="form-control" placeholder="例如：你的文章#('#(page.title ??)')中有人发布评论啦~~~"
                                           name="page_comment_email_notify_title"
                                           value="#option('page_comment_email_notify_title')">
                                </div>
                            </div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">邮件内容</label>
                                <div class="col-sm-6">
                                    <textarea rows="3" class="form-control" placeholder="例如：评论的id是：#('#(comment.id)')，评论的内容是：#('#(comment.content)')"
                                              name="page_comment_email_notify_template" >#option('page_comment_email_notify_template')</textarea>
                                    <p class="text-muted"> 请先在 <a href="#(CPATH)/admin/setting/connection">[通信]</a> 开启邮件功能后才能使用。
                                    </p>
                                </div>
                            </div>


                            <h4 class="form-header">评论短信通知管理员</h4>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">启用</label>
                                <div class="col-sm-6">
                                    <input type="checkbox" class="switchery"
                                           data-for="page_comment_sms_notify_enable"
                                           #checkedIf(option("page_comment_sms_notify_enable"))>
                                    <input type="hidden" id="page_comment_sms_notify_enable"
                                           name="page_comment_sms_notify_enable">
                                    <p class="text-muted"> 请先在 <a href="#(CPATH)/admin/setting">[常规设置]</a> 开填写管理员的手机号。
                                </div>
                            </div>

                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">通知短信模板</label>
                                <div class="col-sm-6">
                                    <textarea rows="2" class="form-control" placeholder="..."
                                              name="page_comment_sms_notify_template">#option('page_comment_sms_notify_template')</textarea>
                                    <p class="text-muted"> 请先在 <a href="#(CPATH)/admin/setting/connection">[通信]</a> 开启短信功能，这里填写阿里云或腾讯云的短信模板ID。
                                    </p>
                                </div>
                            </div>

                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">短信签名</label>
                                <div class="col-sm-6">
                                    <input type="input" class="form-control" placeholder="只有部分服务商需要短信签名"
                                           name="page_comment_sms_notify_sign"
                                           value="#option('page_comment_sms_notify_sign')">
                                    <p class="text-muted"> 请填写阿里云或腾讯云的短信签名。</p>
                                </div>
                            </div>


                        </div>
                        <!-- /.card-body -->
                        <div class="card-footer">
                            <div class="offset-sm-2 col-sm-10 submit-block">
                                <div class="card-submit">
                                    <button type="submit" class="btn btn-primary">提交</button>
                                </div>
                            </div>
                        </div>
                        <!-- /.card-footer -->
                    </form>
                </div>
            </div>

    </section>
#end
